1. Field Of The Invention
The present invention relates to a data-communication method for carrying out data communications between a host station and one or more slave stations, all connected in a loop-type network configuration by data transmission lines.
2. Description Of The Prior Art
FIG. 5 is a block diagram of the architecture of a conventional loop-type data-communication system. In that system, a host station 1 is connected to a plurality of slave stations, which may be portable data-communication terminals 3A, 3C, 3D (each called a "slave station" hereinafter). The slave stations are intended to be attachably and detachably connected into the system. Accordingly, the continuity of the loop type architecture is maintained by having a plurality of junction boxes 2A, 2B, 2C and 2D permanently connected with the host 1 in a loop by a plurality of data transmission lines or cables 4A through 4E. Thus, if a slave station is not connected to o a junction box, as seen with respect to box 2B, the communication loop remains intact. Also, any of the slave stations 3A, 3C and 3D shown in the figure may be detachably connected into the system by plugging it into any other junction box, as seen in the Figure for junction boxes 2C and 2D.
FIG. 6 is a block diagram showing the data-communication equipment, comprising a junction box 2A connected via plugs P1, P2 to a slave station 3A and via switch 6 to transmission lines 4A and 4B, that would be employed when a conventional data-communication method is applied to the system of FIG. 5. In FIG. 6, a connection detecting circuit 5 is located within the junction box 2A and detects the connection of the slave station to the junction box 2A. Switching device 6 is controlled by an output from the connection detecting circuit 5. Switching device 6 has an actuator 6a operatively associated with armature 6b which can electrically connect an input transmission line 4A at terminal C to either one of terminals A and B. Terminal A is connected to output transmission line 4B going to the next station in the loop. Terminal A is also connected via plug P2 and line 42 to the output of a communication I/F circuit 7 accommodated within the slave station 3A. Terminal B is connected via plug P1 and line 40 to the input of I/F circuit 7. The communication I/F circuit 7 converts serial data on the transmission line 4A into parallel data for processing at terminal 3A and converts parallel data from station 3A into serial data for transmission to the host station 1 via transmission line 4B. A dip switch 8 is connected to the I/F circuit and is settable by an operator to input a predetermined code number that uniquely identifies the slave station 3A.
FIG. 7 is a block diagram of the internal structure of communication I/F circuit 7. In FIG. 7, the serial data transmitted from the host 1 on line 4A, if directed by switch 6 to terminal B, is placed on transmission line 40 for input to I/F circuit 7 via plug P1. The serial data signal output by I/F circuit 7 and directed to host 1 or a subsequent station is placed on line 4B via plug P2, line 42 and terminal A of switch 6.
Referring again to the serial input to the I/F circuit 7 on line 40, receiving circuit 11 is operative to shape the input waveform, comprising the serial data signal transmitted from a previous station, and pass the shaped serial waveform data to counting circuit 12 for counting the number of bits in the serial data signal. The bit count is performed in a conventional manner and, as it is conducted, the current count is output on line 44 to comparing circuit 14. The serial data is not changed by the counting circuit 12 but is passed on to data decoding circuit 15 without modification. The code number set in dip switch 8 is input to computing circuit 13, which computes a code value based on the following formula: EQU code value=(code number-1).multidot.n+1 (1)
where n is the number of bits allotted to each station.
The comparing circuit 14 receives the current count number from the data counting circuit 12 and the code value computed by the computing circuit 13 in accordance with equation (1) and compares the two values. If there is no identity, the data stream simply passes through units 15, 20 and 21 and is transmitted to the next station. At the moment that there is an identity between the two values, a coincidence signal is sent to the data decoding circuit 15 on line 45 and to the data encoding circuit 20 on line 43. Data decoding circuit 15 receives the serial data transmitted via receiving circuit 11 and counting circuit 12, and detects n bits in sequence and converts them to parallel data. The parallel data assembled by decoding circuit 15 is output to two destinations. The first and usual destination is data encoding circuit 20, subsequently described. The second destination, upon the occurance of the coincidence signal, is output circuit 16, which shapes the parallel data and passes the data to output I/F circuit 17, for changing the level of the signal outputted by the output circuit 16, and outputting the signal to an internal bus (not illustrated) of the slave station. The slave station internal bus will join a variety of slave station components that are responsive to, and productive of, parallel data information. The details thereof are not relevant to the present invention and need not be disclosed further.
Input I/F circuit 18 is connected to the slave station internal bus and receives signals thereon that were outputted by the slave station components and changes the level of those signals. Input circuit 19 sends the level adjusted signals from the input I/F circuit 18 to data encoding circuit 20. The data encoding circuit 20 will convert the parallel data signal from the input circuit 19 to a serial data signal. The data encoding circuit 20 also receives the parallel data output from data decoding circuit 15 and the coincidence signal from comparing circuit 14, via line 43, indicating identity of the bit count from counting circuit 12 and a code value from computing circuit 13 based on the output of dip switch 8. Encoding circuit 20 will effectively output serial data corresponding to the data received from either decoder 15 or input circuit 19, depending on the state of the coincidence signal 43. Transmitting circuit 21 will synchronize the serial data from encoding circuit 20 with the serial data signal received from the host or the previous station. The synchronized serial data will be passed via line 42 to the next station.
FIG. 8 shows a transmission frame of the serial data signal transmitted from the host station. The transmission frame comprises m time slots, one per station, each slot having n bits. The data destined for slave stations in the system appear sequentially in the frame, ordered from a first station to the mth station. The frame comprises a serial data column of n.times.m bits and is transmitted from the host station 1 to the plurality of slave stations in the system once every communication cycle. The host knows the order in which each slave station appears in the loop and the slot number to which it is assigned, and will read from and write to the frame accordingly. The frame will be distributed to all of the slave stations through the transmission lines and the data for any given station will be selected from the frame on the basis of bit count. That is, station "m" simply extracts the portion of the bit stream destined for it by counting the number of bits received and, assuming ar allocation of "n" bits per station, will extract bits m.multidot.n+1 through (m +1)n (assuming a leader n bits wide precedes the data stream).
The operation of the equipment employing the conventional data-communication method, relevant as background to the present invention, may be explained with reference to FIGS. 5 through 8. Referring initially to FIG. 6, when slave station 3A is not connected to junction box 2A, the armature 6b of switch 6 in that junction box is connected between terminal C and terminal A so that the transmission line 4A can be connected directly to the transmission line that is connected to the next junction box 2B. However, when slave station 3A is connected to the junction box 2A, the connection detecting circuit 5 is operated so that the switch 6 connects contact point C to contact point B, as shown in FIG. 6. When this connection is complete, slave station 3A is able to communicate with the host station 1. A predetermined code number is set in the communication I/F circuit 7 of slave station 3A by operation of the dip switch 8, in a manner known in the art. This number uniquely identifies the slave station, in accordance with its order "m" in the frame with respect to all other slave stations.
Referring now to FIG. 7, the receiving circuit 11 shapes the waveform of the signal of the serial data column sent from the host station 1 and having the transmission frame format shown in FIG. 8. The data counting circuit 12 counts the number of bits thereof, so that the count number can be outputted to the comparing circuit 14 successively, and passes the unaltered serial data column on to decoding circuit 15. The computing circuit 13 computes the code value, using equation (1), the number n of bits of data allocated to each station in the frame and the code number "m" predetermined by the dip switch 8. The code value is output by computing circuit 13 and that value is compared with the count number of the bits of serial data counted by the data counting circuit 12 in comparing circuit 14. If these values do not coincide, the data sent from the host is simply passed on through a transmission circuit 21 in synchronism with the serial data as received from the host, and is sent directly to the next junction box 2B. If the data count number and the code value do coincide with each other, the coincidence signal is outputted from the comparing circuit 14 to the data decoding circuit 15. In response, the serial data decoded into n-bit parallel data by the circuit 15 are outputted via the output circuit 16 and the level conversion and output interface circuit 17. In this manner the parallel data addressed to slave station 3A is output at interface circuit 17 onto the internal bus (not illustrated) of the slave station 3A for processing in the slave station.
When the slave station 3A has data it wishes to communicate to the host 1, it places that data onto its internal bus for access by I/F circuit 7. Specifically, the parallel data that is an input signal to I/F circuit 7 is received at input circuit 19 through the input I/F circuit 18. The received parallel data is decoded into n bits of serial data by the data decoding circuit 20 and is synchronized with the serial data signal sent from the host station 1 by the transmission circuit 21 and sent to the next slave station 2B in the loop. The particular point in the transmission frame where the n bits are inserted will be determined by the output of coincidence circuit 14 to data encoding circuit 20.
As mentioned above, even though all the code numbers of the slave stations 3A, 3C, 3D are different from each other, only a predetermined order of data can be transmitted to the respective slave stations from the host station 1. Whenever a new slave station is added to the loop, its code number must be set to a number other than one presently being used on the loop. This often requires the code number to be changed every time the slave moves from system to system.
According to the conventional data communication method, since the code numbers set at each station must be unique, the code number of a new slave station must be checked and reset every time the slave station is moved and connected to another system. If the code number is not set accurately, it is impossible to receive normal data.
The present invention is directed to solving the aforementioned problem and has as its object the provision of a data-communication method which enables the connection of any slave station to any junction box without the need to check the code number of the slave station each time.